<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
	a.thua__link_1:link { font-size: 14px; text-decoration: none;  color: #0b55c4; }
	a.thua__link_1:visited { font-size: 14px; color: #0b55c4; text-decoration: none; }
	a.thua__link_1:hover { font-size: 14px; text-decoration: none; color: #084095;  font-style: normal; }
</style>
<?php 
	function tinh_so_trang($so_gioi_han)
		{
			$sql="select count(*) from hoa_don_tam";
			$sql1=mysql_query($sql);
			$data=mysql_fetch_row($sql1);
			$st=ceil($data[0]/$so_gioi_han);
			return $st;
		}
	$ssp_td=1;
	$sd=10;
	$so_gioi_han=$ssp_td*$sd;
	if($_GET['trang']=="")
	{
		$vtbd=0;
	}
	else 
	{
		$vtbd=($_GET['trang']-1)*$so_gioi_han;
	}
	$st=tinh_so_trang($so_gioi_han);
?>
<?php 
	if ($_GET[kd_hd]=='kiem_duyet_hd') {
		include "kiemduyet_hd.php";
	}
 ?>
 <h2>Hóa Đơn Chờ Giao Dịch</h2>
<form action="" method="" accept-charset="utf-8">
	<input type="hidden" name="thamso" value="don_dat_hang">
	<input type="hidden" name="kd_hd" value="kiem_duyet_hd">
	<input type="submit" name="" value="Kiểm Duyệt Hóa Đơn">
</form>
<center>
	<table width="990px" id="er" border="1" style="clear:left;margin:6px">
    	<tr>
		<td align="right" colspan="8">
			<span class="span__16">Quản Lý Hóa Đơn Đặt Hàng</span>
			<a href="?home" class="nut_dong" style="color:red">
				Đóng
			</a>
		</td>
	</tr>
		<tr>
			<td width="155px" align="left"><b>Khách Hàng</b></td>
			<td width="155px" align="left"><b>Địa Chỉ</b></td>
			<td width="250px" align="left"><b>CMND</b></td>
            <td width="250px" align="left"><b>Hòm thư</b></td>
			<td width="200px" align="left"><b>Điện thoại</b></td>
            <td width="250px" align="left"><b>Nội dung</b></td>
			<td width="100px" align="center"><b>Xem</b></td>	
			<td width="100px" align="center"><b>Xóa</b></td>
		</tr>
		<?php 
			$tv="select * from hoa_don_tam order by idhd desc  limit $vtbd,$so_gioi_han";
			$tv_1=mysql_query($tv);
			while($tv_2=mysql_fetch_array($tv_1))
			{
				$link_xem_hoa_don="?thamso=xem_hd&id=$tv_2[idHD]&hd_tam=yes";
				$link_xoa_hoa_don="?thamso=xoa_hd&id=$tv_2[idHD]&hd_tam=yes";
				?>
					<tr>
						<td width="155px" align="left"><a href="<?php echo $link_xem_hoa_don; ?>" class="thua__link_1"><?php echo $tv_2['ho_ten'];?></a></td>
						<td width="155px" align="left"><?php echo $tv_2['dia_chi'];?></td>
						<td width="250px" align="left"><?php echo $tv_2['cmnd'];?></td>
                        <td width="250px" align="left"><?php echo $tv_2['hom_thu'];?></td>
						<td width="200px" align="left"><?php echo $tv_2['dien_thoai'];?></td>
                        <td width="250px" align="left"><?php echo $tv_2['noi_dung'];?></td>
						<td width="100px" align="center" id="hello"><a href="<?php echo $link_xem_hoa_don; ?>" style="color:red">Xem</a></td>				
						<td width="100px" align="center" id="hello"><a href="<?php echo $link_xoa_hoa_don; ?>" style="color:red">Xóa</a></td>
					</tr>
				<?php
			}
		?>
	</table>
    <?php
			echo "<div id='trang'>";
		for($i=1;$i<=$st;$i++)
		{
			$link="?thamso=hoa_don&trang=$i";
			echo "<a href='$link' class='hello'><font size='4px'>";
			echo $i;
			echo "</font></a>";echo"  ";
		}
	echo "</div>";
		?>
        <div style="height:10px"></div>
</center>
<script>
	table_css_2("er");
</script>